/**
 *
 */
package com.wedroid.r2d2.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wedroid.entity.contact.GroupMember;
import com.wedroid.entity.message.Message;
import com.wedroid.r2d2.dao.MessageDaoSupport;
import com.wedroid.r2d2.service.MessageService;

/**
 * @author lute
 */
@Service("messageService")
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageDaoSupport messageDaoSupport;

    /* (non-Javadoc)
     * @see com.wedroid.r2d2.service.MessageService#createMessage(com.wedroid.entity.contact.message.Message)
     */
    public void createMessage(Message message) {
        if (message.getGroupMember() == null) {
            message.setGroupMember(new GroupMember());
        }
        messageDaoSupport.creatMessage(message);
    }

}
